﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ME860.DotNetty.Server.Core
{
    public interface IDotNettyServer
    {
        /// <summary>
        /// 产生消息
        /// </summary>
        event Action<string> OnMessage;
        /// <summary>
        /// 产生消息
        /// </summary>
        event Action<string,string> OnSubMessage;
        /// <summary>
        /// 产生消息(异常)
        /// </summary>
        event Action<Exception> OnException;
        /// <summary>
        /// 获取命令
        /// </summary>
        event Func<string> OnGetCommand;
        /// <summary>
        /// 启动服务
        /// </summary>
        /// <returns></returns>
        Task RunServerAsync();
    }
}
